package com.kelvin.paopao.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kelvin.kelvinlib.imageloader.GlideUtil;
import com.kelvin.paopao.R;
import com.kelvin.paopao.api.responseBean.NearByPersonModel;
import com.kelvin.paopao.api.responseBean.PeisongModel;

/**
 * Created by MCK on 2017/5/8.
 */

public class PeisongListAdapter extends BaseQuickAdapter<PeisongModel, BaseViewHolder> {
    private Context context;

    public PeisongListAdapter(Context context) {
        super(R.layout.recyclerview_peisong_item);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, PeisongModel item) {
        ImageView iv = helper.getView(R.id.iv);
        GlideUtil.loadCommonImg(item.getSImg(), R.drawable.default_img, iv, context);
        helper.setText(R.id.tv_price, "￥" + item.getOprice());
        helper.setText(R.id.tv_number, "x" + item.getONum());
        helper.setText(R.id.tv_order_number, "订单编号：" + item.getoId());
        helper.setText(R.id.tv_order_time, "下单时间：" + item.getOaddtime());
        helper.setText(R.id.tv_address, "配送地址：" + item.getOuser() + "(" + item.getUser_name() + ") " +
                item.getOtel() + " " + item.getLname());
        helper.setText(R.id.tv_good_name, item.getSName());
        helper.addOnClickListener(R.id.tv_request);
    }
}
